package com.nsn.das.midas.model.mml.data;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.nsn.das.midas.model.component.Build;
import com.nsn.das.midas.model.component.Feature;
import com.nsn.das.midas.model.component.NetworkElement;
import com.nsn.das.midas.model.component.RevisionHistory;
import com.nsn.das.midas.model.embedded.State;
import com.nsn.das.midas.model.embedded.Version;
import com.nsn.das.midas.model.mml.letter.MMLGroupLetter;
import com.nsn.das.midas.model.user.DASUser;


/*	
* not clear for below fields: 
	PDCLLetter
	PDCLEnMenuText
	PDCLOptionality
	PDCLFeat
	PDCLValues
	PDMMLCommandList
	PDCLDeleted
	AddEditors
	PDNEMUCommands
	PDCentrexCommands
	PDSupervisorCommands
	
*PDClass can be get by group class letter.
*/

@Entity
@Table(name = "mml_program_data")
public class MMLProgramData extends MMLData{
	@Embedded
	private State state;//PDState
	private Date acceptedDate;//PDAcceptedDate
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="letter_id")
	private MMLGroupLetter groupLetter;//PDGroup
	private String mmlName;//PDMMLID
	private String menuText;//PDEnMenuText
	private String pacName;//PDPACName
	private String pacVersion;//PDPACVersion
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<NetworkElement> networkElements;//PDNetworkElement
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<Build> builds;//PDRelease,PDPackage
	private boolean optionality;//PDOptionality
	private String application;//PDApplication
	private String serviceBlock;//PDServBlock
	private DASUser personInCharget;//PDPersonInCharge
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<Feature> features;//PDFeature,PDFeatName
	private boolean active;//PDStatus
	private String additionalInfo;//PDAdditional
	private String reasonForDelay;//PDReasonDelay
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="author_id")
	private DASUser author;//PDAuthor,PDEmail
	private Date created;//PDDate
	@Embedded
	private Version version;//PDVersion
	@OneToMany(fetch=FetchType.LAZY)
	private List<RevisionHistory> histories;//Comments,RevisionHistory


	@OneToMany(fetch=FetchType.LAZY)
	private List<MMLCommandData> commandDatas;//PDNMSCommands

	public List<MMLCommandData> getCommandDatas() {
		return commandDatas;
	}
	
	public void setCommandDatas(List<MMLCommandData> commandDatas) {
		this.commandDatas = commandDatas;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public Date getAcceptedDate() {
		return acceptedDate;
	}

	public void setAcceptedDate(Date acceptedDate) {
		this.acceptedDate = acceptedDate;
	}
	public MMLGroupLetter getGroupLetter() {
		return groupLetter;
	}
	public void setGroupLetter(MMLGroupLetter groupLetter) {
		this.groupLetter = groupLetter;
	}
	public String getMmlName() {
		return mmlName;
	}

	public void setMmlName(String mmlName) {
		this.mmlName = mmlName;
	}

	public String getMenuText() {
		return menuText;
	}

	public void setMenuText(String menuText) {
		this.menuText = menuText;
	}

	public String getPacName() {
		return pacName;
	}

	public void setPacName(String pacName) {
		this.pacName = pacName;
	}

	public String getPacVersion() {
		return pacVersion;
	}

	public void setPacVersion(String pacVersion) {
		this.pacVersion = pacVersion;
	}

	public Set<NetworkElement> getNetworkElements() {
		return networkElements;
	}

	public void setNetworkElements(Set<NetworkElement> networkElements) {
		this.networkElements = networkElements;
	}

	public Set<Build> getBuilds() {
		return builds;
	}

	public void setBuilds(Set<Build> builds) {
		this.builds = builds;
	}

	public boolean isOptionality() {
		return optionality;
	}

	public void setOptionality(boolean optionality) {
		this.optionality = optionality;
	}

	public String getApplication() {
		return application;
	}

	public void setApplication(String application) {
		this.application = application;
	}

	public String getServiceBlock() {
		return serviceBlock;
	}

	public void setServiceBlock(String serviceBlock) {
		this.serviceBlock = serviceBlock;
	}

	public DASUser getPersonInCharget() {
		return personInCharget;
	}

	public void setPersonInCharget(DASUser personInCharget) {
		this.personInCharget = personInCharget;
	}

	public Set<Feature> getFeatures() {
		return features;
	}

	public void setFeatures(Set<Feature> features) {
		this.features = features;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public String getAdditionalInfo() {
		return additionalInfo;
	}

	public void setAdditionalInfo(String additionalInfo) {
		this.additionalInfo = additionalInfo;
	}

	public String getReasonForDelay() {
		return reasonForDelay;
	}

	public void setReasonForDelay(String reasonForDelay) {
		this.reasonForDelay = reasonForDelay;
	}

	public DASUser getAuthor() {
		return author;
	}

	public void setAuthor(DASUser author) {
		this.author = author;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Version getVersion() {
		return version;
	}

	public void setVersion(Version version) {
		this.version = version;
	}

	public List<RevisionHistory> getHistories() {
		return histories;
	}

	public void setHistories(List<RevisionHistory> histories) {
		this.histories = histories;
	}
	
}
